import * as fs from "fs"


/*==================================
本地设置的读取模块
=====================================*/

export default class ConfigData {
    public static pConfig: ConfigData = null;
    public static getInstance(): ConfigData {
        if (ConfigData.pConfig == null) {
            ConfigData.pConfig = new ConfigData();
        }
        return ConfigData.pConfig;
    }
    
    public GetJson(file:string){
        //console.log(file);
        var tmp = fs.readFileSync("./res/"+file+".json","utf8");
        
        let tmpJson = JSON.parse(tmp);
        //console.log(tmpJson);
        return tmpJson;
    }
    public server_json: any = this.GetJson("server");
    // public equip_json: any = EngineUtil.GetResConfig("equipcfg").json;
    
}